// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   getAvailable.java

package hr;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class getAvailable
{

	private String stock;
	private String first;
	private String second;
	private String third;
	private String sql;
	private ResultSet rs;
	private int question_amount;

	public getAvailable()
	{
		stock = "";
		first = "";
		second = "";
		third = "";
		sql = "";
		rs = null;
		question_amount = 0;
	}

	public int available(String unit_db_name, String first, String second)
	{
		this.first = first;
		this.second = second;
		nseer_db dba = new nseer_db(unit_db_name);
		try
		{
			sql = (new StringBuilder("select count(*) from hr_questiones where first_kind_name='")).append(first).append("' and second_kind_name='").append(second).append("'").toString();
			rs = dba.executeQuery(sql);
			if (rs.next())
				question_amount = rs.getInt("count(*)");
			dba.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return question_amount;
	}
}
